home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 API Bible / Windows 95 API Bible 3 Disc Set.iso / Win32 API Bible Book 1 of 3 / CHAPTE24 / EX1.C next >
C/C++ Source or Header  |  1995-07-04  |  1KB  |  32 lines

  1. #include <genstub.c>
  2.  
  3. LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  4. {
  5.     switch (uMsg)
  6.     {
  7.         case WM_COMMAND:  // Process menu options.
  8.                switch ( LOWORD( wParam ) )
  9.                {
  10.                    case IDM_TEST:  // Show results of GetTickCount()
  11.                    {               // and GetCurrentTime() in a message box.
  12.                          TCHAR szBuffer[65];
  13.                          wsprintf( szBuffer,
  14.                                    "GetTickCount: %lu. GetCurrentTime: %lu",
  15.                                    GetTickCount( ), GetCurrentTime( ) );
  16.                          MessageBox( hWnd, szBuffer,
  17.                                      "GetTickCount() Example", MB_OK );
  18.                    }
  19.                    break;
  20.                    case IDM_EXIT:
  21.                          DestroyWindow( hWnd );
  22.                    break;
  23.                }
  24.                break;
  25.         case WM_DESTROY:
  26.                PostQuitMessage( 0 );
  27.                break;
  28.         default:
  29.                return (DefWindowProc(hWnd, uMsg, wParam, lParam));
  30.     }
  31.     return (NULL);
  32. }